package main
import (
	"fmt"
)

type Cat struct{
	Name string
	Age int
}
func main(){
	var allChan chan interface {}

	allChan = make(chan interface{},10)
	
	cat1 :=Cat{Name:"tom",Age:18,}
	cat2 :=Cat{Name:"tom1",Age:128,}

	allChan <- cat1
	allChan <- cat2
	allChan <- 10
	allChan <- "jack"

	// 取出
	cat11 := <- allChan
	// fmt.Println(cat11.Name) // 编译不通过
	// 类型断言
	a := cat11.(Cat)
	fmt.Println(a.Name)

}